﻿using System;
using System.Drawing;
using System.Collections.Generic;

namespace Maze
{
    public class DumbEnemy : Enemy
    {
        private Point startSquare;
        private Point turnSquare;

        public DumbEnemy(Point startSquare, PathFinder pathFinder, Point turnSquare) : base(startSquare, pathFinder)
        {
            this.startSquare = startSquare;
            this.turnSquare = turnSquare;

            this.pathFinder.Find(this.startSquare, this.turnSquare);
        }

        protected override void OnNewSquare(Point square)
        {
            if (square == turnSquare)
            {
                this.pathFinder.Find(this.turnSquare, this.startSquare);
            }
            else if (square == startSquare)
            {
                this.pathFinder.Find(this.startSquare, this.turnSquare);
            }
        }
    }
}
